package com.yhq.spring.event.order;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author hqyin
 * @date 2023/3/13 3:04 下午
 */
@Component
@Slf4j
public class OrderEventListener {
   @EventListener
   @Order(1)
    public void add(OrderEvent orderEvent) {
        log.info("receive add event：{}", orderEvent.getMsgId());
    }

    @EventListener
    @Order(2)
    public void update(OrderEvent orderEvent) {
        log.info("receive update event：{}", orderEvent.getMsgId());
    }

}
